﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/AdminMaster.Master" Inherits="System.Web.Mvc.ViewPage<VietThuongLMS.HocVien>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript" src="<%: Url.Content("~/Scripts/MicrosoftAjax.js") %>"></script>
    <script type="text/javascript" src="<%: Url.Content("~/Scripts/MicrosoftMvcValidation.js") %>"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script>

    <legend>
        Cập Nhật Thông Tin Học Viên
    </legend>

    <%using (Html.BeginForm("Edit", "HocVien", new { area = "Admin" }, FormMethod.Post, new { @class = "form-horizontal", @id = "formNew", @name = "formNew", enctype = "multipart/form-data" })) {%>
        <%: Html.ValidationSummary(true) %>
        
        <%--<fieldset>
            <legend>Fields</legend>--%>
            
        <%--    <div class="editor-label">
                <%: Html.LabelFor(model => model.MaHocVien) %>
            </div>--%>
            
            <div class="control-group">
                <label class="control-label" for="strFrom">
                    Tên Đăng Nhập:</label>
                <div class="controls">
                    <%: Html.TextBoxFor(t => t.TaiKhoan.MaTaiKhoan, new { @class = "h30", placeholder = "Mã Học Viên...", onblur = "check_invalid();", @readonly = "true" })%>
                    <%: Html.ValidationMessageFor(m => m.TaiKhoan.MaTaiKhoan) %>
            
                </div>
            </div>

            <%--<div class="control-group">
                <label class="control-label" for="strfrom"></label>
                <div class="controls field-validation-error">Để trống nếu bạn không muốn thay đổi password!<//div>
            </div>--%>
            <%--<div class="control-group">
                <label class="control-label" for="strfrom">
                    Mật Khẩu :</label>
                <div class="controls">
                    <%: Html.PasswordFor(t => t.TaiKhoan.MatKhau, new { @class = "h30", placeholder = "Mật Khẩu..." })%>
                    <%: Html.ValidationMessageFor(m => m.TaiKhoan.MatKhau)%>
                    <div>*Mật khẩu Tối thiểu 6 ký tự!</div>
                </div>
            </div>--%>

            <div class="control-group">
                <label class="control-label" for="strFrom">
                    Tên tài khoản:</label>
                <div class="controls">
                    <%: Html.TextBoxFor(t => t.TaiKhoan.HoTen, new { @class = "h30", placeholder = "Tên Học Viên...", onblur = "check_invalid();" })%>
                    <%: Html.ValidationMessageFor(m => m.TaiKhoan.HoTen) %>
            
                </div>
            </div>
            <%--<div class="control-group">
                <label class="editor-label" for="strfrom">
                    Mật Khẩu :</label>
                <div class="controls">
                    <%: Html.PasswordFor(t => t.TaiKhoan.MatKhau, new { @class = "h30", placeholder = "Mật Khẩu..." })%>
                    <%: Html.ValidationMessageFor(m => m.TaiKhoan.MatKhau)%>
            
                </div>
            </div>--%>
            <div class="control-group">
                <label class="control-label" for="strFrom">
                    Địa chỉ :</label>
                <div class="controls">
                    <%: Html.TextBoxFor(t => t.TaiKhoan.DiaChi, new { @class = "h30", placeholder = "Địa Chỉ..." })%>
                    <%: Html.ValidationMessageFor(m => m.TaiKhoan.DiaChi)%>
            
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="strFrom">
                    Điện thoại :</label>
                <div class="controls">
                    <%: Html.TextBoxFor(t => t.TaiKhoan.DienThoai, new { @class = "h30", placeholder = "Điện Thoại...", onblur = "check_invalid();" })%>
                    <%: Html.ValidationMessageFor(m => m.TaiKhoan.DienThoai)%>
            
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="strFrom">
                    Email :</label>
                <div class="controls">
                    <%: Html.TextBoxFor(t => t.TaiKhoan.Email, new { @class = "h30", placeholder = "Email...", onblur = "check_invalid();" })%>
                    <%: Html.ValidationMessageFor(m => m.TaiKhoan.Email)%>
            
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="AdminContent">
                    Giới Tính:</label>
                <div class="controls">
                    <%= Html.RadioButtonFor(t => t.TaiKhoan.GioiTinh, "Nam", new { Checked = "checked" })%> Nam
                    <%= Html.RadioButtonFor(t => t.TaiKhoan.GioiTinh, "Nữ")%> Nữ
                    <%= Html.ValidationMessageFor(t => t.TaiKhoan.GioiTinh)%>
                </div>
            </div>
            
            <div class="control-group">
                <label class="control-label" for="AdminContent">
                    Tình Trạng:</label>
                <div class="controls">
                    <%= Html.DropDownList("Deleted")%> 
                </div>
            </div>

            <legend>
            Cập Nhật Thông Tin Người Liên Hệ
            </legend>
            <fieldset>
                <div class="control-group">
                    <label class="control-label" for="strFrom">
                        Họ Tên Người Liên Hệ :</label>
                    <div class="controls">
                        <%: Html.TextBoxFor(t => t.HoTenLienHe, new { @class = "h30", placeholder = "Họ tên người liên hệ..." })%>
                        <%: Html.ValidationMessageFor(m => m.HoTenLienHe)%>
            
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="strFrom">
                        Mối Quan Hệ :</label>
                    <div class="controls">
                        <%: Html.TextBoxFor(t => t.MoiQuanHe, new { @class = "h30", placeholder = "Mối quan hệ..." })%>
                        <%: Html.ValidationMessageFor(m => m.MoiQuanHe)%>
            
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="strFrom">
                        Địa Chỉ Người Liên Hệ :</label>
                    <div class="controls">
                        <%: Html.TextBoxFor(t => t.DiaChiNguoiLienHe, new { @class = "h30", placeholder = "Địa chỉ người liên hệ..." })%>
                        <%: Html.ValidationMessageFor(m => m.DiaChiNguoiLienHe)%>
            
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="strFrom">
                        Điện Thoại Người Liên Hệ :</label>
                    <div class="controls">
                        <%: Html.TextBoxFor(t => t.DienThoaiNguoiLienHe, new { @class = "h30", placeholder = "Điện thoại người liên hệ..." })%>
                        <%: Html.ValidationMessageFor(m => m.DienThoaiNguoiLienHe)%>
            
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="strFrom">
                        Email Người Liên Hệ :</label>
                    <div class="controls">
                        <%: Html.TextBoxFor(t => t.EmailNguoiLienHe, new { @class = "h30", placeholder = "Email người liên hệ..." })%>
                        <%: Html.ValidationMessageFor(m => m.EmailNguoiLienHe)%>
            
                    </div>
                </div>
            </fieldset>


            <div class="control-group">
                <div class="controls">
                    <button id="btnUpdate" name="btnUpdate" type="submit" class="btn btn-primary"><i class="icon-refresh icon-white"></i>Cập Nhật</button>
                </div>
            </div>
        <%--</fieldset>--%>

    <% } %>

    <div>
        <a href="<%=ResolveUrl("~/Admin/HocVien/Index") %>">
        <button class="btn btn-primary">
        <i class="icon-reply"></i>
            Quay lại danh sách
        </button></a>
    </div>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">


    <script type="text/javascript">
        function check_invalid() {
//            var username = $('#TaiKhoan_MaTaiKhoan').val();
//            $.ajax({
//                url: '<%: Url.Action("CheckValid")%>',
//                data: { 'username': username },
//                type: "post",
//                cache: false,
//                success: function (msg) {
//                    if (msg == "False") {
//                        $('#checkpoint').prop('checked', false);
//                        alert("Mã Loại Tài Khoản Không Được Trống");
//                    }
//                    else if (msg == "True")
//                        $('#checkpoint').prop('checked', true);
//                },
//                error: function (xhr, ajaxOptions, thrownError) {
//                    alert("fail");
//                }
//            });
        }
    </script>

</asp:Content>

